use askama_axum::Template;

use chrono::{NaiveDateTime};

#[derive(Clone)]
#[derive(Debug)]
#[derive(Template)] 
#[template(path = "html/blog.html")] 
pub struct ArticleDetail {
	pub id: i32,
	pub title: String,
	pub categorys: Vec<String>,
    pub content: String,
	pub createOn: NaiveDateTime,
}

impl ArticleDetail {
    pub fn new(id: i32, title: String, categorys: Vec<String>, createOn: NaiveDateTime) ->Self {
        ArticleDetail {
            id,
            title,
            categorys,
            content: String::new(),
            createOn,
         }
    }
    
     pub fn setContent(mut self, content: String) -> Self {
        self.content = content;
        self
     }
}




